#!/usr/bin/evn python
# -*- coding: utf-8 -*-
"""
description: please input using description
author: justbk
date: 2021/7/6
modify_records:
    - 2021/7/6 justbk create this file
"""

class TimestampDesc:
    def __init__(self):
        self.tag = None
        self.begin_time = None
        self.end_time = None
        self.is_input = True
        self.warehouse = None
        self.distinct = None
        self.thread_name = None
        self.key = None

    def unique_key(self):
        if self.key is None:
            self.key = "{tag}.{thread}.{warehouse}-{distinct}".format(tag=self.tag,
                                                                      thread=self.thread_name,
                                                                      warehouse=self.warehouse,
                                                                      distinct=self.distinct)
        return self.key

    def get_performance(self):
        return self.end_time - self.begin_time


